package toman;

import java.lang.annotation.Annotation;

/**
 * Implementations of this interface are capable of resolving properties in the given object.
 * <p>
 * User: zslajchrt
 * Date: 2.5.11
 * Time: 17:59
 */
public interface PropertyEvaluator {

    /**
     * @param contextObject the context object possessing properties
     * @param propertyName the property name
     * @return the value of the property in the context object identified by the property name.
     */
    Object getPropertyValue(Object contextObject, String propertyName);

    /**
     *
     * @param contextObject the context object possessing properties
     * @param annotClass the annotation class
     * @param propertyName the property name
     * @param <A> the type of the annotation
     * @return the annotation of the property in the context object identified by the property name.
     */
    <A extends Annotation> A getPropertyAnnotation(Object contextObject, Class<A> annotClass, String propertyName);
}
